package com.lmwyc.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lmwyc.bean.AreaDo;
import com.lmwyc.bean.ExtDayConfig;
import com.lmwyc.bean.UserSession;
import com.lmwyc.mapper.ExtDayConfigMapper;
import com.lmwyc.mapper.UserSessionMapper;
import com.lmwyc.service.IEmployeeService;

@Service
public class EmployeeServiceImpl implements IEmployeeService {
	@Autowired
	private UserSessionMapper userSessionMapper;
	@Autowired
	private ExtDayConfigMapper extDayConfigMapper;
	
	@Override
	public UserSession getUser(String workNum) {
		return userSessionMapper.selectOne(workNum);
	}

	@Override
	public void updateArea(String userId, AreaDo areaDo) {
		userSessionMapper.updateArea(userId, areaDo);
	}
	
	@Override
	public List<ExtDayConfig> getCusConf(String workNum) {
		return extDayConfigMapper.list(workNum);
	}

	@Override
	public void delConf(String confId) {
		extDayConfigMapper.delConf(confId);
	}

	@Override
	public void addConf(String userId, String datePick, int isPunsh) {
		extDayConfigMapper.addConf(datePick, userId, isPunsh);
	}

	@Override
	public void updateMail(String userId, String mailAddress) {
		userSessionMapper.updateMail(userId, mailAddress);
	}

	@Override
	public void updateTime(String userId, Integer time) {
		userSessionMapper.updateTime(userId, time);
	}

	@Override
	public void updateName(String userId, String userName) {
		userSessionMapper.updateName(userId, userName);
	}

	@Override
	public void addUser(String workNum) {
		userSessionMapper.addUser(workNum);
	}
}
